package com.ruoyi.project.mahjong.controller;

import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.framework.web.page.TableDataInfo;
import com.ruoyi.project.mahjong.domain.TMemberLog;
import com.ruoyi.project.mahjong.domain.query.ReprotQuery;
import com.ruoyi.project.mahjong.domain.vo.MemberEventVo;
import com.ruoyi.project.mahjong.domain.vo.UpgradReportVo;
import com.ruoyi.project.mahjong.service.ITMemberLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 用户操作记录Controller
 *
 * @author ruoyi
 * @date 2023-11-12
 */
@RestController
@RequestMapping("/mahjong/newreport")
public class NewReportController extends BaseController
{
    @Autowired
    private ITMemberLogService tMemberLogService;



    @GetMapping("/list")
    public TableDataInfo list(ReprotQuery query)
    {
        startPage();
        List<UpgradReportVo> list = tMemberLogService.selectReport(query.getStartTime(),query.getEndTime());
        return getDataTable(list);
    }
    /**
     * 导出用户操作记录列表
     */

    @GetMapping("/export")
    public AjaxResult export(ReprotQuery query)
    {
        List<UpgradReportVo> list = tMemberLogService.selectReport(query.getStartTime(),query.getEndTime());
        ExcelUtil<UpgradReportVo> util = new ExcelUtil<UpgradReportVo>(UpgradReportVo.class);
        return util.exportExcel(list, "report");
    }


}
